from flask import Flask,request,render_template
from forms import LoginForm
'''
可能需要安装email_validator
'''
app=Flask(__name__)

#设置登录视图函数
@app.route('/login',methods=['GET','POST'])
def login():
    if request.method=="GET":
        return render_template('login.html')
    else:
        form=LoginForm(request.form)
        if form.validate():
            return "登录成功"
        else:
            return "邮箱或密码错误"



@app.route('/')
def mql():
    return 'hello word'




#配置蓝图
#app.register_blueprint(book_bp)
#app.register_blueprint(course_bp)

if __name__=='__main__':
    app.run(debug=True)